package com.own.business.exam.entity.dto;


import com.own.business.exam.entity.bo.ExamRuleQuestionCountBo;
import com.own.component.common.base.entity.BaseDto;
import com.own.constant.ConstantBeanSuffix;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

/**
 * ExamRuleQuestionCountDto
 *
 * @author 陈学礼 （你是一段成熟的代码，要学会自己改bug）
 * @version 4.0.0
 * @date 2021/05/19 14:01:47
 * @since 4.0.0
 */
@ApiModel("考试规则题目类型数量表" + ConstantBeanSuffix.DTO)
@Getter
@Setter
@ToString
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
public class ExamRuleQuestionCountDto extends BaseDto<ExamRuleQuestionCountBo> {

    @ApiModelProperty("规则id")
    private Long ruleId;

    @ApiModelProperty("题目类型")
    private Integer type;

    @ApiModelProperty("数量")
    private Integer number;

    /**
     * 转业务层对象
     *
     * @param entity 原业务层对象
     * @return 业务层对象
     */
    @Override
    public ExamRuleQuestionCountBo toBo(ExamRuleQuestionCountBo entity) {
        if (entity == null) {
            entity = new ExamRuleQuestionCountBo();
        }
        entity.setRuleId(ruleId);
        entity.setType(type);
        entity.setNumber(number);
        return super.toBo(entity);
    }

}
